# Copyright (c) 2021 - 2022 Xilinx, Inc.  All rights reserved.
# Copyright (C) 2022 - 2023 Advanced Micro Devices, Inc.  All rights reserved.
# SPDX-License-Identifier: MIT
cmake_minimum_required(VERSION 3.14.7)
project(axidma)

find_package(common)
collector_create (PROJECT_LIB_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}")
collector_create (PROJECT_LIB_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
include_directories(${CMAKE_BINARY_DIR}/include)
collect (PROJECT_LIB_SOURCES xaxidma.c)
collect (PROJECT_LIB_HEADERS xaxidma.h)
collect (PROJECT_LIB_SOURCES xaxidma_bd.c)
collect (PROJECT_LIB_HEADERS xaxidma_bd.h)
collect (PROJECT_LIB_SOURCES xaxidma_bdring.c)
collect (PROJECT_LIB_HEADERS xaxidma_bdring.h)
collect (PROJECT_LIB_SOURCES xaxidma_g.c)
collect (PROJECT_LIB_HEADERS xaxidma_hw.h)
collect (PROJECT_LIB_HEADERS xaxidma_porting_guide.h)
collect (PROJECT_LIB_SOURCES xaxidma_selftest.c)
collect (PROJECT_LIB_SOURCES xaxidma_sinit.c)
collector_list (_sources PROJECT_LIB_SOURCES)
collector_list (_headers PROJECT_LIB_HEADERS)
file(COPY ${_headers} DESTINATION ${CMAKE_BINARY_DIR}/include)
add_library(axidma STATIC ${_sources})
set_target_properties(axidma PROPERTIES LINKER_LANGUAGE C)
